package com.gzj.canal;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;

/**
 * @author gzj-关镇江QQ332816587
 * @title: CanalConsumer
 * @description:/
 * @addres gzjgod.top
 * @date 2021-08-29 19:59
 **/
@RocketMQMessageListener(consumerGroup = "gzj-group", topic ="topic_gzj")
public class CanalConsumer implements RocketMQListener<MessageExt> {
    /**
     * 消费者监听gzj-topic
     *
     * @param messageExt
     * @param
     */
    @Override
    public void onMessage(MessageExt messageExt) {
        String str =  new String(messageExt.getBody());
        System.out.println(str);
    }
}
